import {getClassifyApi,addClassifyApi,deleteClassifyApi,updateClassifyApi} from '../../api/audit/index'
export const state = () => ({
    tableData: []
})

export const mutations = {
    SET_LIST(state,data){
        state.tableData = data
    },
}

export const actions = {
    // 获取列表
    async getClassify({commit}){
        const r = await getClassifyApi()
        commit('SET_LIST',r.data)
    },

    // 新增列表
    async addClassify({dispatch,commit},data){
        const r = await addClassifyApi(data)
        dispatch('getClassify')
    },

    // 修改列表
    async updateClassify({dispatch,commit},data){
        const r = await updateClassifyApi(data)
        dispatch('getClassify')
    },

    // 删除列表
    async deleteClassify({dispatch,commit},data){
        const r = await deleteClassifyApi(data)
        dispatch('getClassify')
    },
}

export const getters = {
    
}